// 路由跳转封装 

export function param(data) {  
  let url = ''  
  for (let k in data) {  
    let value = data[k] !== undefined ? data[k] : ''  
    url += '&' + k + '=' + encodeURIComponent(value)  
  }  
  return url ? url.substring(1) : ''  
}  

const navigateTo = function(url,data){  
    url += (url.indexOf('?') < 0 ? '?' : '&') + param(data)  
    uni.navigateTo({ url })   
}  

export { navigateTo }